const http = require("http");
const fs = require("fs");
const path = require("path");
http.createServer((req, res) => {
    let filePath = path.join(__dirname, "data.txt");
    let reader = fs.createReadStream(filePath);
    console.log(reader);
    reader.pipe(res);
}).listen(8081);
console.log("server is listening 8081");

//查询防火墙可用端口 sudo firewall-cmd --list-ports
// sudo firewall-cmd --zone=public --add-port=8081/tcp --permanent  开启指定端口
// sudo firewall-cmd  --reload  重启防火墙